1. Field of the Invention
The present invention relates to a technique of effecting a communication of a serial data, hereinafter referred to as a serial data communication. More particularly, it relates to a controller for transmitting or receiving a serial data of arbitrary bit length and a serial data communication system including the controller.
2. Description of the Related Art
In recent years, a serial data communication has been demanded to realize a communication of a serial data having an arbitrary bit length as well as that of a serial data having a fixed bit length. A typical serial data communication is carried out in a system including at least two controllers such as computers connected via a communication line to each other, and carried out by transmitting a parallel data sequentially one bit by bit and receiving the data sequentially transmitted. Computers effect data processing in the form of a parallel data and thus, for example, micro computers must translate a parallel data of 8 bits or 16 bits into a serial data in the outputting of data to the communication line and translate the serial data into the parallel data in the inputting of data from the communication line. The translation is carried out based on a program or, generally, by means of a serial transfer IC for exclusive use. In this case, the input/output of the serial data requires longer time than that of the parallel data. However, if only at least one signal line and a grounded line are provided between the micro computer and external equipment, the serial data communication is possible and thus suitably applied in the case that communication distance is long, or the case that less quantity of information is transmitted.
In view of the above background, there has been proposed a technique capable of switching a bit length of a serial data to effect the serial data communication. In such a serial data communication, the switching of the bit length is carried out by switching a plurality of fixed bit lengths, e.g., 8 bits and 16 bits. Namely, in the prior art, the bit length of data to be transmitted is switched by selecting an optimum one from among several fixed bit lengths.
In the prior art, however, it is impossible to arbitrarily set the bit length and thus a drawback occurs in that the serial data includes unnecessary information together with necessary information and it takes long time to effect the serial data communication. For example, where data to be transmitted is of 6 bits, data corresponding to 2 bits is unnecessarily transmitted when the bit length is switched to 8 bits. Thus, the serial data communication requires extra time.
Also, where a communication of a serial data of 4 bits is carried out in a serial data communication system set to 8-bit length, there arises another problem. Namely, when the transmitting side of the system transmits 4 bits serially from the LSB (least significant bit) side, the receiving side thereof receives 4 bits serially in the MSB (most significant bit) side. Thus, the arrangement of data, i.e., the location of 4-bit data in the 8-bit length, is different between the transmitting side and the receiving side. To adjust the difference of the location of 4-bit data, processing based on software is required and thus a burden to the system is increased.